# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Yejun Yang <yejunx AT gmail DOT com>
# Contributor: Michal Krenek <mikos@sg1.cz>

pkgname=libsrtp
pkgver=1.5.4
pkgrel=2
epoch=1
pkgdesc="Library for SRTP (Secure Realtime Transport Protocol)"
url="https://github.com/cisco/libsrtp"
arch=(i686 x86_64)
license=(BSD)
depends=(glibc)
makedepends=(git)
options=(staticlibs)
_commit=078c4a5b2a4380dea025998ceea9e0a1e3164d2d  # tags/v1.5.4
source=("git+https://github.com/cisco/libsrtp#commit=$_commit")
sha256sums=('SKIP')

# Broken: There are tags like v1.5.4 but also "moving" tags like v1 and v1.5
#pkgver() {
#  cd $pkgname
#  git describe --tags | sed 's/^v//;s/-/+/g'
#}

prepare() {
  cd $pkgname
  autoreconf -fvi
}

build() {
  cd $pkgname
  ./configure --prefix=/usr
  make libsrtp.a shared_library
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
  install -Dm0644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
